<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
	<script type="text/javascript">
	// const obj = new Object()
	
	// 字面量是等号后面的 {}
		const obj = {
			name : 'why',
			age : 18,
			run : function(){
				console.log('奔跑');
			},
			eat: function(){
				console.log("吃饭");
			}
		}
		
		// 1.属性的es6增强写法
		// es5写法
		const name = "why";
		const age = 18;
		const height = 1.88;
		const obj1 = {
			name : name,
			age : age,
			height: height
		}
		console.log(obj1);
		
		
		// 2.es6写法
		const obj2 = {
			name,
			age,
			height
		}
		console.log(obj2);
		// 1.函数的es6增强写法
		// es5写法
		const obj3 = {
			run:function(){
				
			},
			eat:function(){
				
			}
		}
		// es6写法
		const obj4 = {
			run(){
				
			},
			eat(){
				
			}
		}
	</script>
</html>
